import request from '/@/utils/request';

/**
 * 项目版本接口
 *
 */
export function itemVersionApi() {
	return {
		listItemVersions: (itemId) => {
			return request({
				url: '/itemVersion/list?item_id=' + itemId,
				method: 'get',
			});
		},
		addOrUpdateItemVersion: (data?: object) => {
			return request({
				url: '/itemVersion/add',
				method: 'post',
				data,
			});
		},
		delItemVersion: (data?: object) => {
			return request({
				url: '/itemVersion/delete',
				method: 'post',
				data,
			});
		},
		getBuildBranch: (data?: object) => {
			return request({
				url: '/jenkins/getBuildBranch',
				method: 'post',
				data,
			});
		},
		getBuilds: (data?: object) => {
			return request({
				url: '/jenkins/getBuilds',
				method: 'post',
				data,
			});
		},
		getRollbacks: (data?: object) => {
			return request({
				url: '/jenkins/getRollbacks',
				method: 'post',
				data,
			});
		},
		jobBuild: (data?: object) => {
			return request({
				url: '/jenkins/build',
				method: 'post',
				data,
			});
		},
		jobRollback: (data?: object) => {
			return request({
				url: '/jenkins/rollback',
				method: 'post',
				data,
			});
		},
	};
}
